const cryto = require('crypto');

const md5password = (password) => {
  // 返回md5加密对象
  const md5 = cryto.createHash('md5');
  // 拿到字符串,digest()拿到的是buffer
  const result = md5.update(password).digest('hex');
  // 返回结果
  return result;
}

module.exports = md5password;